package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.ArticleInfoDto;
import com.heima.model.user.dtos.LoginDto;
import com.heima.model.user.dtos.UserRelationDto;
import com.heima.model.user.pojos.ApuUerFollow;
import com.heima.user.service.ApUserService;
import com.heima.user.service.ApuUerFollowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/v1/user/")
public class XWUserLoginController {

    //    @Autowired
//    private ApUserService apUserService;
    @Autowired
    private ApuUerFollowService apuUerFollowService;

    /**
     * 关注
     * @param dto
     * @return
     */
    @PostMapping("/user_follow")
    public ResponseResult follow(@RequestBody UserRelationDto dto) {
        return apuUerFollowService.follow(dto);
    }

    /**
     * 查询关注数据
     * @param dto
     * @return
     */
    @PostMapping("/gz/{id}")
    public ApuUerFollow gz(@RequestBody ArticleInfoDto dto,@PathVariable Long id){
     return  apuUerFollowService.gz(dto,id);
    }
}
